﻿namespace Shanda.DevFx.Security.Web.Pages
{
    using Shanda.DevFx;
    using Shanda.DevFx.Security.Web;
    using System;
    using System.Reflection;
    using System.Web.UI.WebControls;

    public class TopPage : Shanda.DevFx.Security.Web.BasePage
    {
        protected Label lblAppTitle;
        protected Label lblVersion;

        protected override void InitData()
        {
            base.InitData();
            AssemblyProductAttribute[] customAttributes = (AssemblyProductAttribute[]) typeof(Framework).Assembly.GetCustomAttributes(typeof(AssemblyProductAttribute), false);
            if ((customAttributes != null) && (customAttributes.Length > 0))
            {
                this.lblVersion.set_Text(customAttributes[0].Product);
            }
            else
            {
                this.lblVersion.set_Text(Assembly.GetExecutingAssembly().GetName().Version.ToString());
            }
            this.lblAppTitle.set_Text(Shanda.DevFx.Security.Web.AppSettings.Instance.AppTitle);
        }

        private void InitializeComponent()
        {
        }

        protected override void OnInit(EventArgs e)
        {
            this.InitializeComponent();
            base.OnInit(e);
        }
    }
}

